package com.bdqn.t382.practice3;

public class Printer {
    private Cartridge cartridge; // 墨盒
    private Paper paper; // 纸张

    // 带有墨盒作为参数的构造方法
    public Printer(Cartridge cartridge) {
        this.cartridge = cartridge;
    }

    public Printer(com.bdqn.t382.practice2.Cartridge cartridge) {
    }

    // 设置纸张的方法
    public void setPaper(Paper paper) {
        this.paper = paper;
    }

    // 打印方法
    public void print(String text) {
        //System.out.println("使用" + paper.getSize() + "打印，paper with " + cartridge.getColor() + " cartridge:");
        System.out.println("使用" +cartridge.getColor() + "在"+paper.getSize()+"上打印");
        System.out.println(text);
    }
}
